package com.qf.ayc.procategory.controller;

import com.qf.ayc.procategory.entity.Procategory;
import com.qf.ayc.procategory.service.IProcategoryService;
import com.qf.ayc.utils.ResultVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author BeautyFairy
 * @since 2024-02-20
 */
@RestController
@CrossOrigin
@Slf4j
@RequestMapping("/procategory")
public class ProcategoryController {
    @Autowired
    private IProcategoryService iProcategoryService;
    @GetMapping("/categorylist")
    public ResultVo categorylist(){
        //1.打印日志
        log.info("分类");
        //2.进行必要的参数校验
        //3.通过service层的对象进行业务处理
        List<Procategory> categorylist = iProcategoryService.List();
        return ResultVo.ok("200","分类表",categorylist);
    }



}
